<?php
/*=============================================================================
|| ##################################################################
||	phpFoX Konsort
|| ##################################################################
||	
||	Copyright		: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation
||	Contact			: info@phpfox.com
||
||	- phpFoX and all of its source code and files are protected by Copyright Laws. 
||
||	- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.). 
||
||	- You may also not remove this copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations). 
||
||	- phpFoX Konsort is NOT a FREE software - http://www.phpfox.com/license/
||
|| ##################################################################
=============================================================================*/

/* $File: ./site/public/forum/posts.php, $Author:  $ */

App::loadAjax('Smiles', array(
	'loadEmoticons'
));

$oReq = &App::getRequest();

phpFoXPlugins::call_phpfox_function('forum_topic_redirect',$oReq->getInt('id'));

$bHidePostBtn = false;

$oSrvSec = &App::getModuleService('Account', 'Security');
/* @var $oSrvSec PhpFox_Mod_Account_ServiceSecurity */
$oAcc = &$oSrvSec->getCurrentUser();

$oSrvForum = &App::getModuleService('Forum', 'Forum');
/* @var $oSrvForum PhpFox_Mod_Forum_ServiceForum */

$bCanPost = $oSrvForum->canWritePost($oReq->getInt('id'), $oAcc);

$sPost = $oReq->get('post');
if ('reply' == $sPost)
{
    $bHidePostBtn = true;
}

$sEditPost = $oReq->get('editpost');
if ($sEditPost)
{
    $bHidePostBtn = true;
}

$oTpl = &App::getTemplate();
$oTpl->assign(array(
    'sPost'        => $sPost,
    'sEditPost'    => $sEditPost,
    'bCanPost'     => $bCanPost,
    'bHidePostBtn' => $bHidePostBtn, 
));
?>